#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

void init(int arr[],int size) {
	for (int i = 0; i < size; i++) {
		arr[i] = 0;
	}
}

void print(int arr[],int size) {
	for (int i = 0; i < size; i++) {
		printf("%d ", arr[i]);
	}
	printf("\n");
}

void reverse(int arr[], int size) {
	for (int i = 0; i < size / 2; i++) {
		int temp;
		temp = arr[i];
		arr[i] = arr[size - i - 1];
		arr[size - i - 1] = temp;
	}
}

int main() {
	int arr[5];
	int size = sizeof(arr)/sizeof(arr[0]);
	init(arr, size);
	print(arr, size);
	for (int i = 0; i < 5; i++) {
		scanf("%d", &arr[i]);
	}
	print(arr, size);
	reverse(arr,size);
	print(arr, size);

	return 0;
}